package com.cdp.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cdp.common.core.domain.AjaxResult;
import com.cdp.common.core.domain.entity.SysRegion;
import com.cdp.common.utils.StringUtils;
import com.cdp.system.mapper.SysRegionMapper;
import com.cdp.system.service.IsysRegionService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysRegionServiceImpl  extends ServiceImpl<SysRegionMapper, SysRegion> implements IsysRegionService {




    @Override
    public List<SysRegion> listRegions() {
        List<SysRegion> list = list();
        return list ;
    }

    /**
     * 地区迷糊查询
     * @param regionName
     * @return
     */
    @Override
    public List<SysRegion> listMistedRegions(String regionName) {
         QueryWrapper<SysRegion> queryWrapper = new QueryWrapper<>();
        if (regionName != null && !regionName.trim().isEmpty()) {
            queryWrapper.like("region_name", regionName);
        }
        return list(queryWrapper);
    }
}
